//---------------------------------------------------------------------------

#ifndef my_protocolH
#define my_protocolH
//---------------------------------------------------------------------------
#endif

#include <windows.h>

#define PACKET_UNKNOWN 			0x0
#define PACKET_AUTORIZATION 	0x00000001
#define PACKET_CMD 				0x00000002
#define PACKET_TELNET 			0x00000003

#define RES_OK 					0x00000001
#define RES_FAILED 				0x00000000

#define CMD_BEEP 				0x00000001
#define CMD_SHUTDOWN 			0x00000002
#define CMD_SETTELNETSTATE 		0x00000003


DWORD GetPacketType(void *buff,u_long datalen);
bool ParcePacket(void *buff,u_long datalen,void *outstruct);
DWORD BuildPacket(DWORD packettype,void *inputstruct,void *outbuff);


/*struct DataPacket
{
	DWORD packettype;
	void* packetdata;
}; */

struct CmdPacket
{
	DWORD command;
	DWORD datalen;
	BYTE *data;
};

struct TelnetPacket
{
	DWORD datalen;
	char *str;
};